import axios from 'axios'
export function request(config){
  const instance = axios.create({
    //baseURL:'http://123.207.32.32:8000',
  //  proxy: {
  //    host: '127.0.0.1',
  //    port: 8888,
  //  },
    baseURL:'127.0.0.1',
    //
    // timeout:3000
  })
  instance.interceptors.request.use(
    config => {
      if (localStorage.getItem('Authorization')) {
        config.headers.Authorization = localStorage.getItem('Authorization');
      }
      return config;
    },
    error => {
      return Promise.reject(error);
    });
  instance.interceptors.response.use(res=>{
    return res.data
  },err=>{
    return err
  })

  return instance(config)
}

export class GoodsInfo {
  constructor(itemInfo){
    this.id = itemInfo.id
    this.title = itemInfo.title
    this.desc = itemInfo.desc
    this.Price = itemInfo.price
    this.discount = itemInfo.discountDesc
  }
}
